package cn.tedu.mall.order.mapper;

import cn.tedu.mall.pojo.order.dto.OrderListTimeDTO;
import cn.tedu.mall.pojo.order.model.OmsOrder;
import cn.tedu.mall.pojo.order.vo.OrderListVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrderMapper {
    @Select("select count(*) from oms_order where sn=#{sn}")
    boolean selectCountBySn(@Param("sn") String sn);

    void insertOrder(OmsOrder omsOrder);

    @Select("select * from oms_order where sn=#{sn}")
    OmsOrder selectOrderBySn(@Param("sn") String sn);

    @Update("update oms_order set state=1 where sn=#{sn}")
    void shutDownOrderBySn(@Param("sn") String sn);

    List<OrderListVO> selectOrdersBetweenTimes(OrderListTimeDTO orderListTimeDTO);
}
